package com.shoes.dao;

import com.shoes.model.UserDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author asen
 */
@Repository
public interface UserDAO {
    UserDO queryUserInfoById(@Param("userId")long userId);
    boolean queryIsExistByPhone(@Param("mobilePhoneNumber")String mobilePhoneNumber);
    String queryPasswordByPhoneNumber(@Param("mobilePhoneNumber")String mobilePhoneNumber);
    String queryPasswordByUserId(@Param("userId")long userId);
    int insertUser(UserDO user);
    boolean updatePasswordByUserId(@Param("userId")long userId, @Param("password")String password);
    boolean updatePasswordByMobilePhoneNumber(@Param("mobilePhoneNumber")String mobilePhoneNumber, @Param("password")String password);
    String queryLoginTokenByUserId(@Param("userId")long userId);
    int updateUserInfo(UserDO user);
    boolean updateDeviceTypeToNull(@Param("userId")long userId);
    Long queryUserIdByPhoneNumber(@Param("mobilePhoneNumber")String mobilePhoneNumber);
    String queryUserNameByUserId(@Param("userId")long userId);
}
